package com.highspeed.bdk.bean.entity.deploy;

import com.bianmaba.spring.data.jpa.domain.annotations.QueryCacheable;
import com.highspeed.bdk.bean.base.IncrementEntity;
import com.highspeed.bdk.bean.entity.logic.App;
import com.highspeed.bdk.bean.entity.physical.Cpu;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.bianmaba.spring.data.jpa.domain.annotations.QueryCacheable;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * Created by chenjiabin on 2018/3/23.
 * App与Cpu绑定器，用于表示在部署拓扑图中App与CPU的绑定关系，使用应用链路来画链路图
 */
@Entity
@DynamicUpdate(true)
@DynamicInsert(true)
@QueryCacheable
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class AppCpuBindor extends IncrementEntity {
    @ManyToOne()
    @JoinColumn(name = "App_id")
    private App app;

    @ManyToOne()
    @JoinColumn(name = "Cpu_id")
    private Cpu cpu;


    public App getApp() {
        return app;
    }

    public void setApp(App app) {
        this.app = app;
    }

    public Cpu getCpu() {
        return cpu;
    }

    public void setCpu(Cpu cpu) {
        this.cpu = cpu;
    }
}
